﻿using QFramework;
using UnityEngine;

namespace ProjectMyFarmAndShe
{
    public class HoeTool : ITool
    {
        public string Name => "锄头工具";
        public string Key => "HoeTool";
        public ToolType Type => ToolType.Tool;
        public float UseBrawn => 3.4f;

        /// <summary>
        /// 开辟土地
        /// 创建网格数据
        /// </summary>
        /// <param name="pos"></param>
        /// <param name="grids"></param>
        public void Use(Vector3Int pos, DynaGrid<GridData> grids)
        {
            var gridData = grids[pos.x, pos.y];
            if(gridData != null) return;

            Global.Brawn.Value -= UseBrawn;
            AudioKit.PlaySound("resources://Hoe");
            
            grids[pos.x, pos.y] = new GridData();
        }
    }
}